var consoleConfig = {
		"suppressErrors": true,
		"time": false,
		"timeEnd": false
};

// Avoid `console` errors in browsers that lack a console.
(function() {
    var method;
    var noop = function () {};
    var methods = [
        'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
        'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
        'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
        'timeStamp', 'trace', 'warn'
    ];
    var length = methods.length;
    var console = (window.console = window.console || {});

    while (length--) {
        method = methods[length];

        // Only stub undefined methods.
        if (!console[method]) {
            console[method] = noop;
        }
    }
}());

function showError(funcName) {
	if(!consoleConfig.suppressErrors) {
		alert("ERROR: logger "+funcName+" setted to FALSE");
	}
}

function getLogger() {
	var logger = {
			time: function(pName) {
				var funcName = "time";
				if(consoleConfig.time) {
					console.time(pName);
				} else { showError(funcName) }
			},
			t: function(arguments) {
				this.time(arguments);
			},
			
			timeEnd: function(pName) {
				var funcName = "timeEnd";
				if(consoleConfig.timeEnd) {
					console.timeEnd(pName);
				} else { showError(funcName) }
			},
			te: function(arguments) {
				this.timeEnd(arguments);
			}
	}
	
	return logger;
}

var log = getLogger();
var lol = log;
